package com.celinux.ce.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author: llq
 * @Date: 2020/6/12
 */
public class FileUtils {
    public static void fileupload(byte[] file, String filePath, String fileName) throws IOException {
        //目标目录
        File targetfile = new File(filePath);
        if (targetfile.exists()) {
            targetfile.mkdirs();
        }
        //二进制流写入
        FileOutputStream out = new FileOutputStream(filePath + fileName);
        out.write(file);
        out.flush();
        out.close();
    }
}
